#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START Python-native
#
# depends: zlib-native
#
# XXX: required for target python.
# Can be used to run meson, and building ninja.


save_CFLAGS="$CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
export CFLAGS="-O2 -g"
export CPPFLAGS="-I${xtools}${build_prefix}/include"
export LDFLAGS="-L${xtools}${build_prefix}/lib"

rm -rf build/native-Python
mkdir -p build/native-Python
cd build/native-Python

../../Python/configure \
	--host=${BUILD} \
	--build=${BUILD} \
	--prefix=${build_prefix} \
	--disable-shared \
	--with-ensurepip \
	${AUTOCRAP_KLUDGE}

cd ../..
make_native_build build/native-Python

export CFLAGS="$save_CFLAGS"
export CPPFLAGS="$save_CPPFLAGS"
export LDFLAGS="$save_LDFLAGS"

# RECIPE END Python-native
